<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <title>首页</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/vant.css">
    <link rel="stylesheet" href="../../css/main.css">
    <style>
       
    </style>
</head>

<body>
    <div class="app store-all" v-cloak>
        <!-- 头 -->
        <div class="header-common">
          <div class="flex-x-s header">
            <span class="iconfont goback" @click="back">&#xe66f;</span>
            <div class="title flex-x-s">
              {{storeInfo.shopName}}
            </div>
            <span class="iconfont goback" @click="search">&#xe71e;</span>
          </div>
          <van-tabs v-model="activeTab" color="#3F8CEC" title-active-color="#3F8CEC" line-height="1px" @click="setFrameIndex">
            <van-tab title="设备出售"></van-tab>
            <van-tab title="设备租赁"></van-tab>
            <van-tab title="二手材料"></van-tab>
            <van-tab title="配件"></van-tab>
          </van-tabs>
        </div>
    </div>
    <script src="../../script/api.js"></script>
    <script src="../../script/flexible.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/vue.min.js"></script>
    <script src="../../script/iconfont.js"></script>
    <script src="../../script/common.js"></script>
    <script src="../../script/vant.min.js"></script>
    <script src="../../script/restful.js"></script>
    <script src="../../script/businessCommon.js"></script>
    <script>
        apiready = function() {
            var aMap = api.require('aMap');
            vm = new Vue({
                el: '.app',
                data: {
                  frames: [{
                      name: 'classify_baby_sell_frm',
                      url: 'classify_baby_sell_frm.html',
                  }, {
                      name: 'classify_baby_lease_frm',
                      url: 'classify_baby_lease_frm.html',
                  },
                  {
                    name: 'classify_baby_deformed_frm',
                    url: 'classify_baby_deformed_frm.html',
                  }
                  , {
                      name: 'classify_baby_part_frm',
                      url: 'classify_baby_part_frm.html',
                  }],
                  headerH:0,
                  activeTab:0,
                  storeInfo: api.pageParam.storeInfo
                },
                created() {
                },
                mounted() {
                  var header = $api.dom('.header-common');
                  this.headerH = $api.fixStatusBar(header);
                  this.openFrame()
                },
                methods: {
                    back(){
                      api.closeWin();
                    },
                    search(){
                      api.openWin({
                        name: 'search_win',
                        url: "../search/search_win.html",
                        pageParam: {
                          isHistory: false,
                          titlePlus: '店铺'
                        }
                      })
                    },
                    openFrame(){
                      var vm = this;
                      vm.frames.map((item) => {
                          item.pageParam = {
                              storeInfo: this.storeInfo,
                          }
                      })
                      api.openFrameGroup({
                          name: 'classify_group',
                          rect: {
                              marginTop: vm.headerH,
                              marginBottom: api.pageParam.footerH,
                              w: 'auto'
                          },
                          scrollEnabled: true,
                          frames: vm.frames,
                          preload: 0,
                          pageParam:api.pageParam
                      }, function(ret, err) {
                          vm.activeTab = ret.index;
                          if (vm.activeTab == 0) {
                              vm.wxList = ['出发地', '目的地', '类型', '货物类型', '更多']
                          } else {
                              vm.wxList = ['地区', '面积', '类型']
                          }
                      });
                    },
                    setFrameIndex(){
                      api.setFrameGroupIndex({
                          name: 'classify_group',
                          scroll: true,
                          index: this.activeTab
                      });
                    }
                },
            })
        }
    </script>
</body>
</html>
